#ifndef TEXTSEARCHDIALOG_H
#define TEXTSEARCHDIALOG_H

#include "ui_textsearchdialog.h"
#include <QDialog>
#include <QtDebug>
#include <QDir>
#include "settingmanage.h"
//#include "searchresultwidget.h"
#include "fileutils.h"
#include <QListWidget>
#include <QTextCodec>
#include "codeeditor.h"
#include "searchitemwidget.h"
#include <QScreen>

namespace Ui {
    class TextSearchDialog;
}

class TextSearchDialog : public QDialog {
    Q_OBJECT

public:
    explicit TextSearchDialog(QWidget *parent = nullptr);

    ~TextSearchDialog();

private
    slots:
            void on_lineEdit_textChanged(
    const QString &arg1
    );

    void searchInDirectory(const QDir &dir, const QString &keyword);

    void on_listWidget_itemSelectionChanged();

    void on_lineEdit_returnPressed();

private:
    Ui::TextSearchDialog *ui;
    CodeEditor *plainTextEdit;

    void initialize();

    void showEvent(QShowEvent *event);

    SettingManage *settingManage;
    QLineEdit *lineEdit;
    QListWidget *listWidget;
    QString rootPath;
    QTextCodec *codec;
    QString m_title = "全文搜索";
};

#endif // TEXTSEARCHDIALOG_H
